package test.com.sms.selenium.singlepoint.util;

import org.openqa.selenium.By;

import test.com.sms.selenium.framework.SeleniumPageUtil;
import test.com.sms.selenium.util.SeleniumUtil;

public class SpIncidentEditAssetDetailsPageUtil extends SeleniumPageUtil {
	public final static By IEAD_LINK_GENERAL_TAB = By.id("btnTab1");
	public final static By IEAD_LINK_CONFIGURATION_TAB = By.id("btnTab2");
	public final static By IEAD_LINK_CONTRACTS_TAB = By.id("btnTab3");
	public final static By IEAD_LINK_WARRANTY_TAB = By.id("btnTab4");
	public final static By IEAD_LINK_INCIDENTS_TAB = By.id("btnTab5");
	public final static By IEAD_LINK_LEASES_TAB = By.id("btnTab6");
	public final static By IEAD_LINK_RETIRE_TAB = By.id("btnTab7");
	public final static By IEAD_LINK_NOTES_TAB = By.id("btnTab9");
	public final static By IEAD_LINK_FEATURES_TAB = By.id("btnTab10");
	public final static By IEAD_LINK_ATTACHMENTS_TAB = By.id("btnTab11");
	
	public final static By IEAD_LINK_INCIDENT_NUMBER = By.xpath("//*[@id='IncidentList1_tblResults']/tbody/tr[3]/td/a");
	public final static By IEAD_TABLE_RESULTS = By.id("IncidentList1_tblResults");
	
	public static void waitForPageToLoad(){
		SeleniumUtil.waitOnElements(new By[]{
				IEAD_LINK_GENERAL_TAB, IEAD_LINK_CONFIGURATION_TAB, IEAD_LINK_CONTRACTS_TAB, IEAD_LINK_WARRANTY_TAB, 
				IEAD_LINK_WARRANTY_TAB, IEAD_LINK_INCIDENTS_TAB, IEAD_LINK_LEASES_TAB, IEAD_LINK_RETIRE_TAB,
				IEAD_LINK_NOTES_TAB, IEAD_LINK_FEATURES_TAB, IEAD_LINK_ATTACHMENTS_TAB
		});
		SeleniumUtil.isDisplayed(SeleniumUtil.getCachedElement(IEAD_LINK_GENERAL_TAB));
		SeleniumUtil.isDisplayed(SeleniumUtil.getCachedElement(IEAD_LINK_CONFIGURATION_TAB));
		SeleniumUtil.isDisplayed(SeleniumUtil.getCachedElement(IEAD_LINK_CONTRACTS_TAB));
		SeleniumUtil.isDisplayed(SeleniumUtil.getCachedElement(IEAD_LINK_WARRANTY_TAB));
		SeleniumUtil.isDisplayed(SeleniumUtil.getCachedElement(IEAD_LINK_WARRANTY_TAB));
		SeleniumUtil.isDisplayed(SeleniumUtil.getCachedElement(IEAD_LINK_INCIDENTS_TAB));
		SeleniumUtil.isDisplayed(SeleniumUtil.getCachedElement(IEAD_LINK_LEASES_TAB));
		SeleniumUtil.isDisplayed(SeleniumUtil.getCachedElement(IEAD_LINK_RETIRE_TAB));
		SeleniumUtil.isDisplayed(SeleniumUtil.getCachedElement(IEAD_LINK_NOTES_TAB));
		SeleniumUtil.isDisplayed(SeleniumUtil.getCachedElement(IEAD_LINK_FEATURES_TAB));
		SeleniumUtil.isDisplayed(SeleniumUtil.getCachedElement(IEAD_LINK_ATTACHMENTS_TAB));
	}
}
